﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace VBAConvertor.Parsers
{
    public class StrAddReplaceParser : ILineParser
    {
        private static readonly Regex StrOp =
            new Regex(
                @" & ",
                RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Singleline);

        public string Parse(Stack<ParseStatus> statuses, string lineContent, LinesReader reader, out bool success, ref bool lineClosed)
        {
            success = true;
            return StrOp.Replace(lineContent, match =>
                {
                    return " + ";
                });
        }
    }
}
